package com.kdd.campus.sh.dao;
import com.kdd.campus.sh.po.ShCategory;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

/****
 * @Author:shenkunlin
 * @Description:ShCategory的Dao
 * @Date 2019/6/14 0:12
 *****/
public interface ShCategoryMapper extends Mapper<ShCategory> {
    @Select("select productNum(*) from sh_product where category_id in(select c.id from sh_category c where c.parent_id=#{categoryId});")
    int getProductCountByCategory(Integer categoryId);
}
